//
//  BanlanceNavView.m
//  SanYiTeaching
//
//  Created by 李文强 on 2019/4/29.
//  Copyright © 2019 SanYi. All rights reserved.
//

#import "BanlanceNavView.h"

@implementation BanlanceNavView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (void)initOption{
    [self addSubview:self.allButton];
    [_allButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.mas_centerY);
        make.right.equalTo(@0).offset(-20);
        make.width.equalTo(@50);
        make.height.equalTo(@20);
    }];
}
- (UIButton *)allButton{
    if (!_allButton) {
        UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
        [button setBackgroundImage:[UIImage imageNamed:@"6231559633043_.pic_hd"] forState:0];
        button.titleLabel.font = [UIFont systemFontOfSize:13];
        [button setTitleColor:SELECTEDCOLOR forState:UIControlStateNormal];
        [button setTitle:@"全部" forState:UIControlStateNormal];
        [button addTarget:self action:@selector(selectedAll:) forControlEvents:UIControlEventTouchUpInside];
        _allButton  =button;
    }
    return _allButton;
}
- (void)selectedAll:(UIButton *)sender{
    [self.delegate submiteClick];
}
- (void)drawRect:(CGRect)rect{
    UIBezierPath *path = [[UIBezierPath alloc]init];
    [path moveToPoint:CGPointMake(0, 43)];
    [path addLineToPoint:CGPointMake(self.frame.size.width, 43)];
    [LINCOLOR set];
    [path stroke];
}
@end
